<?= $this->Html->css('form'); ?>
<?= $this->Html->css('payment'); ?>

<div class="form_wrapper">
<?=$session->flash();?>
<?
	$user = $this->Session->read('Auth.User');
?>
		<?php
		echo $this->Form->create('User', array('action' => 'billing', 'autocomplete' => 'off')); 
		/* echo "<div style='float:left; margin-right: 10px;'>Select payment method</div>";
		$options = array(
			'visa' => 'Visa', 
			'master' => 'Master Card',
			'discover' => 'Discover'
		);
		echo $this->Form->select('Credit Card', $options);
		echo "<div style='clear:both'></div>";
		echo $this->Form->input('Billing address', array('label' => 'Billing address')); */
?>
<div class="title" style="margin-top:30px">Billing contact</div>
<ul class="editBox">
	<li>
		<span class="titleName">First Name</span>
		<?=$this->Form->input('first_name', array('label'=>false,'div'=>false));?>
	</li>
	<li>
		<span class="titleName">Last Name</span>
		<?=$this->Form->input('last_name', array('label' => false, 'div' => false)); ?>
	</li>
	<li>
		<span class="titleName">Phone number</span>
		<?=$this->Form->input('phone', array('label' => false, 'div' => false,
			'pattern' => '^[0-9\\+]{7,12}',
			'title' => 'Please enter a valid phone number')); ?>
	</li>
	<li>
		<span class="titleName">Alternative phone number</span>
		<?=$this->Form->input('alternative_phone', array('label' => false, 'div' => false,
			'pattern' => '^[0-9\\+]{7,12}',
			'title' => 'Please enter a valid phone number')); ?>
	</li>
</ul>

<div class="title" style="margin-top:30px">Billing address</div>
<ul class="editBox">
	<li>
		<span class="titleName" style="margin-top:-50px">Address</span>
		<?=$this->Form->input('address', array('label' => false, 'div' => false, 'type' => 'textarea')); ?>
	</li>
	<li>
		<span class="titleName">ZIP Code</span>
		<?=$this->Form->input('zip_code', array('label' => false, 'div' => false,
			'pattern' => '^[0-9]{2,6}',
			'title' => 'Please enter a valid zip code')); ?>
	</li>
</ul>

<div class="title" style="margin-top: 30px">Payment method</div>
<div id="card_wrapper" style="margin-left:25%">
	<ul id="payment-credit-method-cc0-type" class="card-types detector mbl" style=""> 
		<li class="VISA first card" id="coherent_id_395"> 
			<span id="coherent_id_396">VISA</span> 
		</li> 
		<li class="MASTERCARD card" id="coherent_id_397"> 
			<span id="coherent_id_398">MASTERCARD</span> 
		</li> 
		<li class="AMERICAN_EXPRESS card" id="coherent_id_399"> 
			<span id="coherent_id_400">AMERICAN_EXPRESS</span> 
		</li> 
		<li class="DISCOVER last card" id="coherent_id_401"> 
			<span id="coherent_id_402">DISCOVER</span> 
		</li> 
	</ul>
</div>
<ul class="editBox">
	<li>
		<span class="titleName">Debit/Credit Card Number</span>
		<?=$this->Form->input('card_number', array('label' => false, 'div' => false,
			'pattern' => '^4\d{3}-?\d{4}-?\d{4}-?\d{4}$')); ?>
	</li>
	<li>
		<span class="titleName">Security Code</span>
		<?=$this->Form->input('security_code', array('label' => false, 'div' => false,
			'pattern' => '^[0-9]{3}$')); ?>
	</li>
	<li>
		<span class="titleName">Expires</span>
		<? echo $form->input('expires', array(
				'type'=>'date',
				'dateFormat' => 'DMY',
				'empty'=>true,
				'minYear'=>2012, 
				'maxYear'=>2042, 
				'class'=>'text',
				'div'=>false,  
				'label'=>false, 
				'separator' => '&nbsp;',
				'style'=>'width: 100px;'));
		?>
	</li>
</ul>
<?
	echo $this->Form->end('Save');
?>
</div>
